package com.android.nfctouch.manager;

import android.content.Context;

import com.android.baselibrary.interface_.OkHttpCallBack;
import com.android.nfctouch.constants.ApiConstants;
import com.lzy.okgo.model.HttpMethod;

import java.util.HashMap;
import java.util.Map;

public class API_HomeManager {

    //Banner
    public static void banner_list(Context context, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.banner_list;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }

    //获取联系方式类型列表
    public static void home_contact_type(Context context, int limit, int page, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.home_contact_type;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("limit", limit + "");
        bodyParames.put("page", page + "");
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }

    //添加
    public static void home_contact_add(Context context, String content, String linkId, int status, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.home_contact_add;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("content", content);
        bodyParames.put("linkId", linkId);
        bodyParames.put("status", status);
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }

    //编辑联系方式
    public static void home_contact_update(Context context, String content, String userLinkId, int status, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.home_contact_update;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("content", content);
        bodyParames.put("userLinkId", userLinkId);
        bodyParames.put("status", status);
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }


    //获取用户联系方式列表
    public static void home_contact_list(Context context, int limit, int page, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.home_contact_list;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("limit", limit + "");
        bodyParames.put("page", page + "");
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }

    //删除用户联系方式
    public static void home_contact_delete(Context context, String id, OkHttpCallBack<?> callBack) {
        String url = Config.SERVER_HOST + ApiConstants.home_contact_delete;
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("id", id);
        OkHttpManager.okHttpRequest_Json(context, HttpMethod.POST, url, urlParames, null, bodyParames, callBack);
    }


}
